#include "OptionDialog.h"
#include "GameConfig.h"


OptionDialog::OptionDialog(QWidget *parent)
	: QDialog(parent)
{
	setupUi(this);

	// layout()->setSizeConstraint(QLayout::SetFixedSize);
    setFixedSize(size());
    InitContent();
}


OptionDialog::~OptionDialog(void)
{
}

void OptionDialog::InitContent()
{
    switch (GameConfig::Instance()->Mode())
    {
    case GB::MOD_2P:
        rb2p->setChecked(true);
        break;
    case GB::MOD_AI_BLACK:
        rbCompBlack->setChecked(true);
        break;
    case GB::MOD_AI_WHITE:
        rbCompWhite->setChecked(true);
        break;
    default:
        break;
    }

    cbLevel->setCurrentIndex(GameConfig::Instance()->Level());
}
